<script type="text/javascript">
$(document).ready(function(){
	$("#pager_page").mainPager({
		name: 'page',
		pager: "#pager_page",
		url: '/page/admin/ajax.pager.page<?php echo Main_Const::getSeriveUrlStr(); ?>',
		urlEdit: '/page/admin/page.edit<?php echo Main_Const::getSeriveUrlStr(); ?>',
		urlLink: '/page/admin/block.list<?php echo Main_Const::getSeriveUrlStr(); ?>',
		rowList: [2,4,6,8],
		rowNum: 8,
		sortname: 'path',
		sord: 'asc',
		colNames: {
			id: 'ID',
			path: 'Путь',
			layout_name: 'Шаблон',
			f_active: 'Статус'
		},
		colModel: {
			id: {index: ['id'], width: '7%'},
			path: {index: ['page_name', 'level'], width: '46%', handler: 'pagerPagePathHandler', sort: ['lft']},
			layout_name: {index: ['layout_name'], width: '20%'},
			f_active: {index: ['f_active'], width: '17%', handler: 'pagerIsActiveHandler'}
		},
		emptyList: 'Список пуст',
		actionsWidth: '8%'
	});
});

/**
 * @param object indexObj
 * @return string
 */
function pagerPagePathHandler(indexObj) {
	var res = '';
	for (var i=0; i < indexObj.level-1; i++) {
		res += '&nbsp;&nbsp;&nbsp;&nbsp;'; 
	}
	res += '/' + indexObj.page_name; 
	
	return res;
}

</script>	

<h3 class="action-name">Страницы</h3>
<div class="button">
<button type="submit" onclick="window.location='/page/admin/page.add<?php echo Main_Const::getSeriveUrlStr(); ?>'" class="controll-button" name="Submit" >Добавить</button>
</div>
<div style="text-align: right; margin-right: 12px;">
	<input type="text" class="simple-search" />
</div>

<div id="pager_page"></div>

